<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>isFinite isNaN</title>
</head>

<body>
    <pre>
Number.isFinite()  //判断是否是有限的
Number.isNaN()  //判断是不是NaN
</pre
    >
  </body>
</html>
<script>
  const PI = Math.PI;
  console.log(Number.isFinite(PI)); //判断是否是有限的
  console.log(Number.isNaN(PI)); //判断是不是NaN
  console.log(Number.parseInt(PI));
  console.log(Number.parseFloat(PI));
</script>